#!/usr/bin/env bash

# set -e: exit asap if a command exits with a non-zero status
# set -x: print each command right before it is executed
set -xe

# Docker
docker --version || echo "INFO: No docker installed yet"
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
  # # Let's wait until Travis provides Docker for OSX
  # docker --version || exit 0
  # docker --version && exit 1 #that's how I'll know
  ./test/before_install_docker_osx
  # https://github.com/github/hub#homebrew
else
  ./test/before_install_docker_linux
fi
docker --version || (echo "FATAL: No docker installed" && exit 1)

# Docker Compose
docker-compose --version || (echo "FATAL: No docker compose installed" && exit 1)
